﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XYS.Core.Models;

namespace XYS.Core.Util
{
    /// <summary>
    /// 扩展
    /// </summary>
    public static partial class Extention
    {
        /// <summary>
        /// 判断是否为匿名用户
        /// </summary>
        /// <param name="currentUserInfo"></param>
        /// <returns></returns>
        public static bool IsAnonymous(this CurrentUserInfo currentUserInfo)
        {
            return currentUserInfo.AccountId <= 0 || string.IsNullOrWhiteSpace(currentUserInfo.Token);
        }
    }
}